<!DOCTYPE html>
<html lang="en">
<head lang="en">
    <meta charset="utf-8">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta content="telephone=no" name="format-detection">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="robots" content="none"> 
    <title>下载地址</title>
    <style>
        .bg{position: fixed;top:0;left:0;bottom: 0;right: 0;background:url('/static/downback.jpeg') no-repeat;background-size: cover;background-position: center center;color: #fff;text-align: center;font-size: 16px;}
        .top{margin-top: 1rem;}
        .top>img{width: 4rem;vertical-align: middle;}
        .middle{position: absolute;top:50%;width: 100%;left: 0;margin-top: -1.2rem;}
        .middle>img{width: 6rem;margin: 2rem 0;}
        .bottom{margin-top: 0.6rem;position: absolute;bottom: 1rem;width: 100%;left: 0;}
        #download_btn,#download_btn_back{width: 6rem;margin: .5rem auto;border: 1px solid #fff;height:.9rem;line-height: .9rem;border-radius: 10px;}
    </style>
    <script>
        var designWidth = 750;
        function fontSize() {
            var CW = document.documentElement.clientWidth;
            if(CW>=750){
                CW=750
            }
            var size = CW / designWidth * 100 + "px";
            document.querySelector("html").style.fontSize = size;
        }
        fontSize();
    </script>
</head>
<body>
    <div class="bg">
        <div class="top">
            <img src="/static/logo.png">
        </div>
        <div class="middle">
            <div id="download_btn">用户端下载</div>
            <div id="download_btn_back">管理端下载</div>
        </div>
        
        <p class="bottom">
            请使用手机浏览器打开
        </p>
    </div>
<script type="text/javascript">
    function isWeiXin(){
        var ua = window.navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i) == 'micromessenger'){
            return true;
        }else{
            return false;
        }
    }
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    var module = {
        init: function(){
            this.events();
        },
        events: function(){
            var that = this;
            document.getElementById('download_btn').onclick=function(){
                if( isAndroid ) {
                    if(isWeiXin()) {
                        alert('点击右上角，选择"浏览器"打开。');
                    } else {       
                        window.location.href= 'http://47.100.185.138:9000/customer/photo/app-yonghuduan.apk';     
                    }
                } else {
                    window.location.href= 'https://apps.apple.com/cn/app/id1503863334';
                }
            };
            document.getElementById('download_btn_back').onclick=function(){
                if( isAndroid ) {
                    if(isWeiXin()) {
                        alert('点击右上角，选择"浏览器"打开。');
                    } else {       
                        window.location.href= 'http://47.100.185.138:9000/customer/photo/app-guanliduan.apk';     
                    }
                } else {
                    window.location.href= 'http://47.100.185.138:9000/customer/photo/app-guanliduan.apk';  
                }
            }
        }
    };
    module.init();
</script>
</body>
</html>